package cn.qp.controller;

import cn.qp.pojo.Person;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author qipan
 * @date 2020/01/11 15:02
 */
@Controller
public class IndexController {

    @RequestMapping("/")
    public ModelAndView show() {
        ModelAndView modelAndView = new ModelAndView("index");
        final Person person = new Person();
        person.setId(10);
        person.setName("张三");
        modelAndView.addObject("person",person);
        return modelAndView;
    }
}
